home *** CD-ROM | disk | FTP | other *** search
/ Workplace Effectiveness:…ecision-Making Strategies / Workplace Effectiveness: Decision-Making Strategies.iso / pc / Files / View.dxr / 00010_sprite handlers.ls < prev    next >
Encoding:
Text File  |  1998-12-16  |  1.5 KB  |  63 lines

  1. global gHandCursor, gHandMask, gFingerCursor, gFingerMask
  2.  
  3. on clickButton action
  4.   set spriteNum to the clickOn
  5.   set castMember to the member of sprite spriteNum
  6.   set Castname to the name of member castMember
  7.   set castNum to the castLibNum of member castMember
  8.   puppetSprite(spriteNum, 1)
  9.   repeat while the mouseDown
  10.     if rollOver(spriteNum) then
  11.       set the member of sprite spriteNum to member (Castname && "dn") of castLib castNum
  12.       updateStage()
  13.       next repeat
  14.     end if
  15.     set the member of sprite spriteNum to castMember
  16.     updateStage()
  17.   end repeat
  18.   set the member of sprite spriteNum to castMember
  19.   updateStage()
  20.   puppetSprite(spriteNum, 0)
  21.   if rollOver(spriteNum) then
  22.     do(action)
  23.   end if
  24. end
  25.  
  26. on setPuppetState channelList, type, state
  27.   if type = #c then
  28.     repeat with n = getAt(channelList, 1) to getAt(channelList, 2)
  29.       puppetSprite(n, state)
  30.     end repeat
  31.   else
  32.     repeat with n in channelList
  33.       puppetSprite(n, state)
  34.     end repeat
  35.   end if
  36. end
  37.  
  38. on setHandCursor cState, handList
  39.   case cState of
  40.     #on:
  41.       repeat with X in handList
  42.         set the cursor of sprite X to gHandCursor
  43.       end repeat
  44.     #off:
  45.       repeat with X in handList
  46.         set the cursor of sprite X to 0
  47.       end repeat
  48.   end case
  49. end
  50.  
  51. on setFingerCursor cState, fingerList
  52.   case cState of
  53.     #on:
  54.       repeat with X in fingerList
  55.         set the cursor of sprite X to gFingerCursor
  56.       end repeat
  57.     #off:
  58.       repeat with X in fingerList
  59.         set the cursor of sprite X to 0
  60.       end repeat
  61.   end case
  62. end
  63.